#include<stdio.h>

int removeDuplicates(int* nums, int numsSize){
	int slowIndex = 0;
	int fastIndex = 1;

	while (fastIndex < numsSize)
	{
		int tmp = nums[slowIndex];
		if (nums[fastIndex] == tmp)
		{
			fastIndex++;
		}
		else
		{
			nums[++slowIndex] = nums[fastIndex++];
		}
	}
	return slowIndex;
}

int main()
{
	int arr[] = { 0, 0, 1, 1, 1, 2, 2, 3, 3, 4 };
	int ret = removeDuplicates(arr, 10);
	printf("%d\n", ret);

	return 0;
}